<template>
	<view class="detailBox">
		<view class="mart-30">
			<template v-if="thisData&&thisData.length">
				<view class="topContent readBox" v-for="(item,index) in thisData">
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">实施单位</text>
						</u-col>
						<u-col span="6">
							<text class="label-name">{{item.companyName}}</text>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">实施人员</text>
						</u-col>
						<u-col span="6">
							<text class="label-name">{{item.userName}}</text>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">实施日期</text>
						</u-col>
						<u-col span="6">
							<text class="label-name">{{item.doDate|ymd}}</text>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">实施照片</text>
						</u-col>
						<u-col span="3" textAlign="center">
							<u-button type="warning" @click="onShowDetail('img',item)" size="small"
								text="查看"></u-button>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">备注</text>
						</u-col>
						<u-col span="6">
							<text class="label-name">{{item.remark}}</text>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">状态</text>
						</u-col>
						<u-col span="6">
							<text class="label-name">{{$enums.StockWireropeKeep_Status.Get(item.status).text}}</text>
						</u-col>
					</u-row>
					<u-line class="marb-20"></u-line>
					<u-row gutter="0" class="marb-20">
						<u-col span="4" textAlign="center">
							<text class="label-name">操作</text>
						</u-col>
						<u-col span="3" textAlign="center">
							<u-button type="warning" @click="onShowDetail('info',item)" size="small" text="详情"></u-button>
						</u-col>
					</u-row>

				</view>
			</template>
			<view v-else>
				<view class="topContent">
					<u-empty mode="data" text="暂无数据">
					</u-empty>
				</view>
			</view>
		</view>
		<!-- 预览 -->
		<ImgShow :list="previewImgs" ref="ImgShowRef" @hide="onPreviewHide()"></ImgShow>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				thisID: null,
				thisData: {

				},
				previewImgs: []
			}
		},
		onLoad(options) {
			let that = this;
			// #ifdef APP-NVUE
			const eventChannel = this.$scope.eventChannel; // 兼容APP-NVUE
			// #endif

			// #ifndef APP-NVUE
			const eventChannel = this.getOpenerEventChannel();
			// #endif
		},
		beforeDestroy() {

		},
		methods: {
			init(data) {
				this.thisData = data.stockWireropeKeepModelList;
				return;
			},
			onShowDetail(type, row) {
				if(type=='img'){
					this.previewImgs = row.pic_ImgsList;
					this.$refs.ImgShowRef.show();
				}else{
					let url = '/pages/spareRopeMaintenance/detail';
					uni.navigateTo({
						url: url,
						success: function(res) {
							res.eventChannel.emit('editData', {
								data: row,
								operateType: '详情'
							});
						}
					});
				}
				
			},
			onPreviewHide() {
				
			}
		}
	}
</script>

<style>

</style>